package com.test.nnooolwdeaer.bean_wooden.user_info_wooden;

import com.test.nnooolwdeaer.util_wooden.StringUtil_wooden;
import com.google.gson.Gson;

import org.json.JSONObject;

/**
 * 用户登录信息，只在用户手动登录时获取，自动登录不获取
 */
public class LoginInfo_wooden {

    private static class Inner_wooden {
        private static LoginInfo_wooden instance = new LoginInfo_wooden();
    }

    private LoginInfo_wooden(){}

    public static LoginInfo_wooden getInstance_wooden(){
        return Inner_wooden.instance;
    }

    private String type,token,userId;

    public static void parse_wooden(JSONObject objJson){
        Inner_wooden.instance = new Gson().fromJson(objJson.toString(), LoginInfo_wooden.class);
    }

    public String getToken_wooden() {
        return StringUtil_wooden.getSafeString_wooden(token);
    }

    public String getUserId_wooden() {
        return StringUtil_wooden.getSafeString_wooden(userId);
    }

    public String getType_wooden() {
        return StringUtil_wooden.getSafeString_wooden(type);
    }

}
